package com.wei.dubbo.demo.init.consumer;

import com.wei.dubbo.demo.init.common.service.InitDemoService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 类的详细说明
 *
 * @author buhuan.wang
 * @since 2021/2/18
 */
public class InitConsumerApp {
    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext(new String[] {"spring/dubbo-consumer.xml"});
        context.start();
        InitDemoService demoService = (InitDemoService) context.getBean("demoService"); // 获取远程服务代理
        String hello = demoService.sayHello("world"); // 执行远程方法
        System.out.println("--- " + hello); // 显示调用结果
    }
}
